blob: 87b520218efd87f7c97342dbe20d22793c1dbe91 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
import { PartnersBiddingList } from '@/lib/bidding/vendor/partners-bidding-list'
import * as React from "react"
import { getServerSession } from 'next-auth'
import { authOptions } from "@/app/api/auth/[...nextauth]/route"
import { getBiddingListForPartners } from '@/lib/bidding/detail/service'
import { Shell } from '@/components/shell'
import { DataTableSkeleton } from '@/components/data-table/data-table-skeleton'
import { useTranslation } from "@/i18n"
interface IndexPageProps {
params: Promise<{ lng: string }>
}
export default async function PartnersBidPage({ params }: IndexPageProps) {
const { lng } = await params;
const { t } = await useTranslation(lng, 'menu')
// 세션에서 companyId 가져오기
const session = await getServerSession(authOptions)
const companyId = session?.user?.companyId
if (!companyId) {
return (
<div className="container mx-auto py-6">
<div className="text-center">
<h1 className="text-2xl font-bold text-destructive">회사 정보가 없습니다. 다시 로그인 해주세요.</h1>
</div>
</div>
)
}
// 서버 사이드에서 입찰 목록 데이터 가져오기
const promises = Promise.all([
getBiddingListForPartners(companyId),
])
return (
<Shell className="gap-2">
<div className="container mx-auto py-6 space-y-6">
<div className="flex items-center justify-between">
<div>
<h1 className="text-3xl font-bold">{t('menu.vendor.bidding.list')}</h1>
<p className="text-muted-foreground mt-2">
{t('menu.vendor.bidding.list_desc')}
</p>
</div>
</div>
<React.Suspense
fallback={
<DataTableSkeleton
columnCount={6}
searchableColumnCount={1}
filterableColumnCount={2}
cellWidths={["10rem", "40rem", "12rem", "12rem", "8rem", "8rem"]}
shrinkZero
/>
}
>
<PartnersBiddingList companyId={companyId} promises={promises} />
</React.Suspense>
</div>
</Shell>
)
}
|